-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the recipe function #218
Conversation
- The `recipeFunction` now uses `SlotMatchResult#getGivenInput` instead of `SlotMatchResult#getRecipeIngredient` to get the inputs. - Implemented `InputList` with `.getAt()` `.findMarked()` and `findMarkedOrEmpty()` methods to get the mark. - Changed the `inputs` parameter of the function to `InputList` type. - `IIngredient` now implements `IMarkable`. - Renamed both `ItemStackMixin#getMark` & `ItemStackMixin#setMark` methods to `ItemStackMixin#grs$getMark` & `ItemStackMixin#grs$setMark`. `.getMark()` & `.setMark()` are now part of `ItemStackMixinExpansion`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vanilla.groovy
got moved to a subfolder on the main branch, which is why yours is conflicting
src/main/java/com/cleanroommc/groovyscript/compat/vanilla/CraftingRecipe.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cleanroommc/groovyscript/compat/vanilla/CraftingRecipe.java
Show resolved
Hide resolved
src/main/java/com/cleanroommc/groovyscript/compat/vanilla/CraftingRecipe.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this pr you assume that the givenInput
can have a mark, which is not true. The given input is the same item from the current crafting grid, which is never marked. The mark only exists on the input ingredients of the recipe and not the actual matched items. So your example shouldnt even work
src/main/java/com/cleanroommc/groovyscript/api/IIngredient.java
Outdated
Show resolved
Hide resolved
Nevermind what i said |
The
recipeFunction
now usesSlotMatchResult#getGivenInput
instead ofSlotMatchResult#getRecipeIngredient
to get the inputs.Implemented
InputList
with.getAt()
.findMarked()
andfindMarkedOrEmpty()
methods to get the mark.Changed the
inputs
parameter of the function toInputList
type.IIngredient
now implementsIMarkable
.Renamed both
ItemStackMixin#getMark
&ItemStackMixin#setMark
methods toItemStackMixin#grs$getMark
&ItemStackMixin#grs$setMark
..getMark()
&.setMark()
are now part ofItemStackMixinExpansion
.